A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Not Selected and (cm.start_date = '0000-00-00' or ('24-04-27' >= cm.start_date a' at line 8

SELECT cm.id, cm.title,cm.title_2 ,IFNULL(ctr.id,0) as txn_id,ctr.block_reason as lock_message,ctr.pay_via,(CASE when ctr.id is not null or FIND_IN_SET(0,cm.free_ids)>0 then 1 else 0 END) as is_purchased, cm.course_attribute, cm.left_text as l_text , cm.right_text as r_text , cm.color_code as color_code ,cm.is_emi_available,cm.offer_valid,cm.validity_type,cm.start_date,cm.end_date, cm.cover_image as image_icon , cm.desc_header_image, cm.mrp ,cm.course_sp , cm.color_code , cm.validity ,CONCAT('#',cm.is_locked,'#') as revert_api -- cm.payment_type From course_master as cm left join course_transaction_record ctr on ctr.course_id=cm.id and ctr.transaction_status=1 and ((ctr.creation_time/1000)+(86400*30*cm.validity))>1714240498 and ctr.user_id=0 Where cm.id = Not Selected and (cm.start_date = '0000-00-00' or ('24-04-27' >= cm.start_date and '24-04-27' <= cm.end_date ))

Filename: modules/data_model/models/Exam_model.php

Line Number: 105